<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>RanoreXPath 语法示例 | Ranorex Studio用户手册</title>
    <meta name="generator" content="VuePress 1.8.0">
    <link rel="icon" href="/ranorex/img/favicon.ico">
    <script data-ad-client="ca-pub-7828333725993554" async="async" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <meta name="description" content="用户指南的第一章将引导您完成创建第一个自动化测试用例的过程。了解如何在不编码的情况下自动执行测试、验证条目、查看测试报告等。后面的章节涵盖高级主题，例如使用 Selenium WebDriver 进行跨浏览器测试和为移动应用程序测试准备设备。">
    <meta name="keywords" content="用户指南的第一章将引导您完成创建第一个自动化测试用例的过程。了解如何在不编码的情况下自动执行测试、验证条目、查看测试报告等。后面的章节涵盖高级主题，例如使用 Selenium WebDriver 进行跨浏览器测试和为移动应用程序测试准备设备。">
    <meta name="baidu-site-verification" content="7F55weZDDc">
    <meta name="theme-color" content="#11a8cd">
    
    <link rel="preload" href="/ranorex/assets/css/0.styles.4f9f6236.css" as="style"><link rel="preload" href="/ranorex/assets/js/app.24b7eaa5.js" as="script"><link rel="preload" href="/ranorex/assets/js/2.ec9fdd2b.js" as="script"><link rel="preload" href="/ranorex/assets/js/80.6c0ca93e.js" as="script"><link rel="prefetch" href="/ranorex/assets/js/10.10740124.js"><link rel="prefetch" href="/ranorex/assets/js/100.e7028cb5.js"><link rel="prefetch" href="/ranorex/assets/js/101.57840c4c.js"><link rel="prefetch" href="/ranorex/assets/js/102.f88ac37b.js"><link rel="prefetch" href="/ranorex/assets/js/103.3f4ef0af.js"><link rel="prefetch" href="/ranorex/assets/js/104.1c3987fc.js"><link rel="prefetch" href="/ranorex/assets/js/105.39bd6f16.js"><link rel="prefetch" href="/ranorex/assets/js/106.6d99777c.js"><link rel="prefetch" href="/ranorex/assets/js/107.a772dfce.js"><link rel="prefetch" href="/ranorex/assets/js/108.1f6106fd.js"><link rel="prefetch" href="/ranorex/assets/js/109.61465bce.js"><link rel="prefetch" href="/ranorex/assets/js/11.15aa2ac8.js"><link rel="prefetch" href="/ranorex/assets/js/110.87f08865.js"><link rel="prefetch" href="/ranorex/assets/js/111.6de4977a.js"><link rel="prefetch" href="/ranorex/assets/js/112.ac81b438.js"><link rel="prefetch" href="/ranorex/assets/js/113.e4324abb.js"><link rel="prefetch" href="/ranorex/assets/js/114.76da90e6.js"><link rel="prefetch" href="/ranorex/assets/js/115.b0302cf5.js"><link rel="prefetch" href="/ranorex/assets/js/116.dc9013d8.js"><link rel="prefetch" href="/ranorex/assets/js/117.5650909e.js"><link rel="prefetch" href="/ranorex/assets/js/118.83c3ad11.js"><link rel="prefetch" href="/ranorex/assets/js/119.99ea8a2f.js"><link rel="prefetch" href="/ranorex/assets/js/12.f887e0d3.js"><link rel="prefetch" href="/ranorex/assets/js/120.5158a9fc.js"><link rel="prefetch" href="/ranorex/assets/js/121.cd6389de.js"><link rel="prefetch" href="/ranorex/assets/js/122.30b6e23a.js"><link rel="prefetch" href="/ranorex/assets/js/123.14ef94d2.js"><link rel="prefetch" href="/ranorex/assets/js/124.774c039f.js"><link rel="prefetch" href="/ranorex/assets/js/125.ec98d72a.js"><link rel="prefetch" href="/ranorex/assets/js/126.a5374d41.js"><link rel="prefetch" href="/ranorex/assets/js/127.6bb71a7f.js"><link rel="prefetch" href="/ranorex/assets/js/128.dddf9e5d.js"><link rel="prefetch" href="/ranorex/assets/js/129.803e1198.js"><link rel="prefetch" href="/ranorex/assets/js/13.98375c72.js"><link rel="prefetch" href="/ranorex/assets/js/130.7fe218d8.js"><link rel="prefetch" href="/ranorex/assets/js/131.ccdb53c7.js"><link rel="prefetch" href="/ranorex/assets/js/132.f059a1a9.js"><link rel="prefetch" href="/ranorex/assets/js/133.4108c727.js"><link rel="prefetch" href="/ranorex/assets/js/134.9d680a15.js"><link rel="prefetch" href="/ranorex/assets/js/135.6a9d4859.js"><link rel="prefetch" href="/ranorex/assets/js/136.2198a58d.js"><link rel="prefetch" href="/ranorex/assets/js/137.ee7cb289.js"><link rel="prefetch" href="/ranorex/assets/js/138.26c7e792.js"><link rel="prefetch" href="/ranorex/assets/js/139.eeb24972.js"><link rel="prefetch" href="/ranorex/assets/js/14.45cccdbd.js"><link rel="prefetch" href="/ranorex/assets/js/140.7ec1802a.js"><link rel="prefetch" href="/ranorex/assets/js/141.fb7a23f0.js"><link rel="prefetch" href="/ranorex/assets/js/142.6749eff4.js"><link rel="prefetch" href="/ranorex/assets/js/143.431594af.js"><link rel="prefetch" href="/ranorex/assets/js/144.a2f5ce52.js"><link rel="prefetch" href="/ranorex/assets/js/145.0601585d.js"><link rel="prefetch" href="/ranorex/assets/js/146.16feb8bc.js"><link rel="prefetch" href="/ranorex/assets/js/147.5053e695.js"><link rel="prefetch" href="/ranorex/assets/js/148.a353c0d0.js"><link rel="prefetch" href="/ranorex/assets/js/149.31c0ff28.js"><link rel="prefetch" href="/ranorex/assets/js/15.f23b2dea.js"><link rel="prefetch" href="/ranorex/assets/js/150.6542abfd.js"><link rel="prefetch" href="/ranorex/assets/js/151.43e948e3.js"><link rel="prefetch" href="/ranorex/assets/js/152.dd6cabb1.js"><link rel="prefetch" href="/ranorex/assets/js/153.f014da37.js"><link rel="prefetch" href="/ranorex/assets/js/154.6ee45ca5.js"><link rel="prefetch" href="/ranorex/assets/js/155.6ba5415a.js"><link rel="prefetch" href="/ranorex/assets/js/156.e601c1e5.js"><link rel="prefetch" href="/ranorex/assets/js/157.407e013c.js"><link rel="prefetch" href="/ranorex/assets/js/158.0bb7c774.js"><link rel="prefetch" href="/ranorex/assets/js/159.17154eef.js"><link rel="prefetch" href="/ranorex/assets/js/16.5154513b.js"><link rel="prefetch" href="/ranorex/assets/js/160.9d4cb6ba.js"><link rel="prefetch" href="/ranorex/assets/js/161.a53a87be.js"><link rel="prefetch" href="/ranorex/assets/js/162.54b97f63.js"><link rel="prefetch" href="/ranorex/assets/js/163.546cbc2d.js"><link rel="prefetch" href="/ranorex/assets/js/164.7bc339ce.js"><link rel="prefetch" href="/ranorex/assets/js/165.67d4304a.js"><link rel="prefetch" href="/ranorex/assets/js/166.7c1be565.js"><link rel="prefetch" href="/ranorex/assets/js/167.bd0167b7.js"><link rel="prefetch" href="/ranorex/assets/js/168.1aa7878a.js"><link rel="prefetch" href="/ranorex/assets/js/169.d90b4e9c.js"><link rel="prefetch" href="/ranorex/assets/js/17.5fcd13ca.js"><link rel="prefetch" href="/ranorex/assets/js/170.cb5db4fb.js"><link rel="prefetch" href="/ranorex/assets/js/171.b8147650.js"><link rel="prefetch" href="/ranorex/assets/js/172.53f22d79.js"><link rel="prefetch" href="/ranorex/assets/js/173.0e60c801.js"><link rel="prefetch" href="/ranorex/assets/js/174.8c29f5a4.js"><link rel="prefetch" href="/ranorex/assets/js/175.caa398e0.js"><link rel="prefetch" href="/ranorex/assets/js/176.36e20920.js"><link rel="prefetch" href="/ranorex/assets/js/177.1b8ca17e.js"><link rel="prefetch" href="/ranorex/assets/js/178.686cd676.js"><link rel="prefetch" href="/ranorex/assets/js/179.62ed8882.js"><link rel="prefetch" href="/ranorex/assets/js/18.3410087d.js"><link rel="prefetch" href="/ranorex/assets/js/180.a0a2165c.js"><link rel="prefetch" href="/ranorex/assets/js/181.8af8faa3.js"><link rel="prefetch" href="/ranorex/assets/js/182.dc2e7167.js"><link rel="prefetch" href="/ranorex/assets/js/183.ef7688da.js"><link rel="prefetch" href="/ranorex/assets/js/184.5707a5ec.js"><link rel="prefetch" href="/ranorex/assets/js/185.72e933f8.js"><link rel="prefetch" href="/ranorex/assets/js/186.ac3e0f9e.js"><link rel="prefetch" href="/ranorex/assets/js/187.703ef8ea.js"><link rel="prefetch" href="/ranorex/assets/js/188.d04772eb.js"><link rel="prefetch" href="/ranorex/assets/js/189.549c54cf.js"><link rel="prefetch" href="/ranorex/assets/js/19.f5a747d2.js"><link rel="prefetch" href="/ranorex/assets/js/190.a7fb60b7.js"><link rel="prefetch" href="/ranorex/assets/js/191.0b9e402d.js"><link rel="prefetch" href="/ranorex/assets/js/192.db701f56.js"><link rel="prefetch" href="/ranorex/assets/js/193.86245113.js"><link rel="prefetch" href="/ranorex/assets/js/194.26dcdaa9.js"><link rel="prefetch" href="/ranorex/assets/js/195.341ac6b9.js"><link rel="prefetch" href="/ranorex/assets/js/196.e12e179b.js"><link rel="prefetch" href="/ranorex/assets/js/197.604689a4.js"><link rel="prefetch" href="/ranorex/assets/js/198.2e49a4fc.js"><link rel="prefetch" href="/ranorex/assets/js/199.a1811557.js"><link rel="prefetch" href="/ranorex/assets/js/20.fcd6c62f.js"><link rel="prefetch" href="/ranorex/assets/js/200.bbfc3813.js"><link rel="prefetch" href="/ranorex/assets/js/201.dfbdd0b3.js"><link rel="prefetch" href="/ranorex/assets/js/202.4d01f6a5.js"><link rel="prefetch" href="/ranorex/assets/js/203.2fc1b32a.js"><link rel="prefetch" href="/ranorex/assets/js/204.a18e0686.js"><link rel="prefetch" href="/ranorex/assets/js/205.8559eb21.js"><link rel="prefetch" href="/ranorex/assets/js/206.febc4af9.js"><link rel="prefetch" href="/ranorex/assets/js/207.3824dcf1.js"><link rel="prefetch" href="/ranorex/assets/js/208.60a33728.js"><link rel="prefetch" href="/ranorex/assets/js/209.d933f506.js"><link rel="prefetch" href="/ranorex/assets/js/21.cf8fbb66.js"><link rel="prefetch" href="/ranorex/assets/js/210.8f377e06.js"><link rel="prefetch" href="/ranorex/assets/js/211.26f8be02.js"><link rel="prefetch" href="/ranorex/assets/js/212.4a64d44c.js"><link rel="prefetch" href="/ranorex/assets/js/213.fdeb4f41.js"><link rel="prefetch" href="/ranorex/assets/js/214.e34e9a0b.js"><link rel="prefetch" href="/ranorex/assets/js/215.ce7a5ee6.js"><link rel="prefetch" href="/ranorex/assets/js/216.660d864f.js"><link rel="prefetch" href="/ranorex/assets/js/217.b9b06dc0.js"><link rel="prefetch" href="/ranorex/assets/js/218.1c9eb327.js"><link rel="prefetch" href="/ranorex/assets/js/219.9f170a55.js"><link rel="prefetch" href="/ranorex/assets/js/22.148be82a.js"><link rel="prefetch" href="/ranorex/assets/js/220.15dc816e.js"><link rel="prefetch" href="/ranorex/assets/js/221.80b3442a.js"><link rel="prefetch" href="/ranorex/assets/js/222.704d161c.js"><link rel="prefetch" href="/ranorex/assets/js/223.1145a930.js"><link rel="prefetch" href="/ranorex/assets/js/224.f1da1ddc.js"><link rel="prefetch" href="/ranorex/assets/js/225.fa6a9452.js"><link rel="prefetch" href="/ranorex/assets/js/226.18a3865a.js"><link rel="prefetch" href="/ranorex/assets/js/23.cc718ca8.js"><link rel="prefetch" href="/ranorex/assets/js/24.86da407f.js"><link rel="prefetch" href="/ranorex/assets/js/25.f55794a8.js"><link rel="prefetch" href="/ranorex/assets/js/26.034daa9c.js"><link rel="prefetch" href="/ranorex/assets/js/27.2fbbd462.js"><link rel="prefetch" href="/ranorex/assets/js/28.211c41f6.js"><link rel="prefetch" href="/ranorex/assets/js/29.04c0999c.js"><link rel="prefetch" href="/ranorex/assets/js/3.ae597d9c.js"><link rel="prefetch" href="/ranorex/assets/js/30.393ae7bc.js"><link rel="prefetch" href="/ranorex/assets/js/31.c8ad9771.js"><link rel="prefetch" href="/ranorex/assets/js/32.77f25c7a.js"><link rel="prefetch" href="/ranorex/assets/js/33.893cd8eb.js"><link rel="prefetch" href="/ranorex/assets/js/34.ad372005.js"><link rel="prefetch" href="/ranorex/assets/js/35.8b8dfbb2.js"><link rel="prefetch" href="/ranorex/assets/js/36.d4e0c135.js"><link rel="prefetch" href="/ranorex/assets/js/37.616da736.js"><link rel="prefetch" href="/ranorex/assets/js/38.2432a079.js"><link rel="prefetch" href="/ranorex/assets/js/39.8b943467.js"><link rel="prefetch" href="/ranorex/assets/js/4.22fd3e1a.js"><link rel="prefetch" href="/ranorex/assets/js/40.e8eaccc8.js"><link rel="prefetch" href="/ranorex/assets/js/41.76a9eede.js"><link rel="prefetch" href="/ranorex/assets/js/42.89ea171c.js"><link rel="prefetch" href="/ranorex/assets/js/43.f856cbbb.js"><link rel="prefetch" href="/ranorex/assets/js/44.58030fb1.js"><link rel="prefetch" href="/ranorex/assets/js/45.3d09c2fa.js"><link rel="prefetch" href="/ranorex/assets/js/46.b245fc56.js"><link rel="prefetch" href="/ranorex/assets/js/47.bc3b2fa7.js"><link rel="prefetch" href="/ranorex/assets/js/48.b46f224f.js"><link rel="prefetch" href="/ranorex/assets/js/49.4cb3377b.js"><link rel="prefetch" href="/ranorex/assets/js/5.02a8399a.js"><link rel="prefetch" href="/ranorex/assets/js/50.202bba60.js"><link rel="prefetch" href="/ranorex/assets/js/51.70007468.js"><link rel="prefetch" href="/ranorex/assets/js/52.cb4cc59e.js"><link rel="prefetch" href="/ranorex/assets/js/53.8eb695b2.js"><link rel="prefetch" href="/ranorex/assets/js/54.f840fad6.js"><link rel="prefetch" href="/ranorex/assets/js/55.3a7ca993.js"><link rel="prefetch" href="/ranorex/assets/js/56.e54f166f.js"><link rel="prefetch" href="/ranorex/assets/js/57.cc924439.js"><link rel="prefetch" href="/ranorex/assets/js/58.1b6a4239.js"><link rel="prefetch" href="/ranorex/assets/js/59.6e538365.js"><link rel="prefetch" href="/ranorex/assets/js/6.4754e26a.js"><link rel="prefetch" href="/ranorex/assets/js/60.24be2f8a.js"><link rel="prefetch" href="/ranorex/assets/js/61.37707aa9.js"><link rel="prefetch" href="/ranorex/assets/js/62.3f142075.js"><link rel="prefetch" href="/ranorex/assets/js/63.ffca709a.js"><link rel="prefetch" href="/ranorex/assets/js/64.71472536.js"><link rel="prefetch" href="/ranorex/assets/js/65.5a22e1db.js"><link rel="prefetch" href="/ranorex/assets/js/66.12137ec5.js"><link rel="prefetch" href="/ranorex/assets/js/67.216d94c5.js"><link rel="prefetch" href="/ranorex/assets/js/68.b547be06.js"><link rel="prefetch" href="/ranorex/assets/js/69.500ef0be.js"><link rel="prefetch" href="/ranorex/assets/js/7.8d47de9d.js"><link rel="prefetch" href="/ranorex/assets/js/70.17ab2354.js"><link rel="prefetch" href="/ranorex/assets/js/71.becd4c9d.js"><link rel="prefetch" href="/ranorex/assets/js/72.0a81c3ac.js"><link rel="prefetch" href="/ranorex/assets/js/73.c3f7b9bc.js"><link rel="prefetch" href="/ranorex/assets/js/74.489b5d01.js"><link rel="prefetch" href="/ranorex/assets/js/75.15b80f90.js"><link rel="prefetch" href="/ranorex/assets/js/76.37e86e91.js"><link rel="prefetch" href="/ranorex/assets/js/77.8a96a11b.js"><link rel="prefetch" href="/ranorex/assets/js/78.1089236e.js"><link rel="prefetch" href="/ranorex/assets/js/79.2d89654c.js"><link rel="prefetch" href="/ranorex/assets/js/8.197778c9.js"><link rel="prefetch" href="/ranorex/assets/js/81.c09d0fd2.js"><link rel="prefetch" href="/ranorex/assets/js/82.2cf30b53.js"><link rel="prefetch" href="/ranorex/assets/js/83.6a836fd5.js"><link rel="prefetch" href="/ranorex/assets/js/84.f56aeffe.js"><link rel="prefetch" href="/ranorex/assets/js/85.fa5f1544.js"><link rel="prefetch" href="/ranorex/assets/js/86.f5d69b57.js"><link rel="prefetch" href="/ranorex/assets/js/87.5da46a4d.js"><link rel="prefetch" href="/ranorex/assets/js/88.2d708653.js"><link rel="prefetch" href="/ranorex/assets/js/89.cd2fa46c.js"><link rel="prefetch" href="/ranorex/assets/js/9.9807028d.js"><link rel="prefetch" href="/ranorex/assets/js/90.33ee88ae.js"><link rel="prefetch" href="/ranorex/assets/js/91.f157a5e7.js"><link rel="prefetch" href="/ranorex/assets/js/92.5652bd0e.js"><link rel="prefetch" href="/ranorex/assets/js/93.4adefe5e.js"><link rel="prefetch" href="/ranorex/assets/js/94.18953313.js"><link rel="prefetch" href="/ranorex/assets/js/95.87b602b5.js"><link rel="prefetch" href="/ranorex/assets/js/96.8eb960e1.js"><link rel="prefetch" href="/ranorex/assets/js/97.19ab9295.js"><link rel="prefetch" href="/ranorex/assets/js/98.3782e119.js"><link rel="prefetch" href="/ranorex/assets/js/99.23b63326.js">
    <link rel="stylesheet" href="/ranorex/assets/css/0.styles.4f9f6236.css">
  </head>
  <body class="theme-mode-light">
    <div id="app" data-server-rendered="true"><div class="theme-container sidebar-open have-rightmenu"><header class="navbar blur"><div title="目录" class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/ranorex/" class="home-link router-link-active"><img src="/ranorex/img/RX-logo.png" alt="Ranorex Studio用户手册" class="logo"> <span class="site-name can-hide">Ranorex Studio用户手册</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/ranorex/" class="nav-link">首页</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="基础" class="dropdown-title"><a href="/ranorex/pages/978dd7/" class="link-title">基础</a> <span class="title" style="display:none;">基础</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ranorex/pages/db051d/" class="nav-link">在20分钟内了解 Ranorex</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/d5a062/" class="nav-link">Ranorex Studio</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/d8d817/" class="nav-link">Ranorex 录制器</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/1f8583/" class="nav-link">测试套件</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/3ff037/" class="nav-link">动作</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/980f3d/" class="nav-link">控件库</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/2c14f7/" class="nav-link">验证测试</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/8b8105/" class="nav-link">白名单</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/894a89/" class="nav-link">报告</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="高级" class="dropdown-title"><a href="/ranorex/pages/11401f/" class="link-title">高级</a> <span class="title" style="display:none;">高级</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ranorex/pages/554573/" class="nav-link">数据驱动测试</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/331ecc/" class="nav-link">追踪UI元素</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/6943ae/" class="nav-link">Ranorex Spy</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/134d22/" class="nav-link">UI元素</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/686444/" class="nav-link">RanoreXPath</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/64711f/" class="nav-link">基于图像的自动化</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/005bb9/" class="nav-link">维护模式</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/11012a/" class="nav-link">性能跟踪</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="专家" class="dropdown-title"><a href="/ranorex/pages/9af963/" class="link-title">专家</a> <span class="title" style="display:none;">专家</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ranorex/pages/2f0192/" class="nav-link">映射动态UI元素</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/ecebd0/" class="nav-link">RanoreXPath 中的正则表达式</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/847ee6/" class="nav-link">用户代码库</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/b31e73/" class="nav-link">代码模块</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/811ea3/" class="nav-link">Ranorex Studio 集成开发环境</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/f87d8c/" class="nav-link">Ranorex 自动化助手</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="网页和移动测试" class="dropdown-title"><a href="/ranorex/pages/7ccd5d/" class="link-title">网页和移动测试</a> <span class="title" style="display:none;">网页和移动测试</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ranorex/pages/d74538/" class="nav-link">Web测试</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/645c60/" class="nav-link">端点</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/6d8643/" class="nav-link">移动测试</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/dfc2b0/" class="nav-link">高级移动测试</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="接口和连接" class="dropdown-title"><a href="/ranorex/pages/89b55d/" class="link-title">接口和连接</a> <span class="title" style="display:none;">接口和连接</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ranorex/pages/b79789/" class="nav-link">Ranorex仪器向导</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/43beb2/" class="nav-link">技术仪器</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/7bcce0/" class="nav-link">源代码控制和修订控制</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/7d74b6/" class="nav-link">XCOPY 部署</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/18df29/" class="nav-link">持续集成</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/88ee43/" class="nav-link">TestRail 集成</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/9c9cdb/" class="nav-link">Applitools Eyes 集成</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/f9f2a2/" class="nav-link">远程桌面的 Ranorex</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/1121bd/" class="nav-link">Visual Studio 集成</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/fc83cd/" class="nav-link">Selenium Webdriver 集成</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/38db78/" class="nav-link">插件</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="系统详细信息" class="dropdown-title"><a href="/ranorex/pages/92d4ae/" class="link-title">系统详细信息</a> <span class="title" style="display:none;">系统详细信息</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ranorex/pages/b40b84/" class="nav-link">证书</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/d75d8f/" class="nav-link">设置和配置</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/0f08c7/" class="nav-link">系统要求</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/86b798/" class="nav-link">64位平台</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/31b776/" class="nav-link">静默安装</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="实践应用主题" class="dropdown-title"><a href="/ranorex/pages/74e52a/" class="link-title">实践应用主题</a> <span class="title" style="display:none;">实践应用主题</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ranorex/pages/5011c0/" class="nav-link">构建您的测试</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/83d6aa/" class="nav-link">常见问题的解决方案</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/8ea041/" class="nav-link">最佳实践</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/93ab6d/" class="nav-link">代码示例</a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <div class="sidebar-hover-trigger"></div> <aside class="sidebar" style="display:none;"><!----> <nav class="nav-links"><div class="nav-item"><a href="/ranorex/" class="nav-link">首页</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="基础" class="dropdown-title"><a href="/ranorex/pages/978dd7/" class="link-title">基础</a> <span class="title" style="display:none;">基础</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ranorex/pages/db051d/" class="nav-link">在20分钟内了解 Ranorex</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/d5a062/" class="nav-link">Ranorex Studio</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/d8d817/" class="nav-link">Ranorex 录制器</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/1f8583/" class="nav-link">测试套件</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/3ff037/" class="nav-link">动作</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/980f3d/" class="nav-link">控件库</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/2c14f7/" class="nav-link">验证测试</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/8b8105/" class="nav-link">白名单</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/894a89/" class="nav-link">报告</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="高级" class="dropdown-title"><a href="/ranorex/pages/11401f/" class="link-title">高级</a> <span class="title" style="display:none;">高级</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ranorex/pages/554573/" class="nav-link">数据驱动测试</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/331ecc/" class="nav-link">追踪UI元素</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/6943ae/" class="nav-link">Ranorex Spy</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/134d22/" class="nav-link">UI元素</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/686444/" class="nav-link">RanoreXPath</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/64711f/" class="nav-link">基于图像的自动化</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/005bb9/" class="nav-link">维护模式</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/11012a/" class="nav-link">性能跟踪</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="专家" class="dropdown-title"><a href="/ranorex/pages/9af963/" class="link-title">专家</a> <span class="title" style="display:none;">专家</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ranorex/pages/2f0192/" class="nav-link">映射动态UI元素</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/ecebd0/" class="nav-link">RanoreXPath 中的正则表达式</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/847ee6/" class="nav-link">用户代码库</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/b31e73/" class="nav-link">代码模块</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/811ea3/" class="nav-link">Ranorex Studio 集成开发环境</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/f87d8c/" class="nav-link">Ranorex 自动化助手</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="网页和移动测试" class="dropdown-title"><a href="/ranorex/pages/7ccd5d/" class="link-title">网页和移动测试</a> <span class="title" style="display:none;">网页和移动测试</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ranorex/pages/d74538/" class="nav-link">Web测试</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/645c60/" class="nav-link">端点</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/6d8643/" class="nav-link">移动测试</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/dfc2b0/" class="nav-link">高级移动测试</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="接口和连接" class="dropdown-title"><a href="/ranorex/pages/89b55d/" class="link-title">接口和连接</a> <span class="title" style="display:none;">接口和连接</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ranorex/pages/b79789/" class="nav-link">Ranorex仪器向导</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/43beb2/" class="nav-link">技术仪器</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/7bcce0/" class="nav-link">源代码控制和修订控制</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/7d74b6/" class="nav-link">XCOPY 部署</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/18df29/" class="nav-link">持续集成</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/88ee43/" class="nav-link">TestRail 集成</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/9c9cdb/" class="nav-link">Applitools Eyes 集成</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/f9f2a2/" class="nav-link">远程桌面的 Ranorex</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/1121bd/" class="nav-link">Visual Studio 集成</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/fc83cd/" class="nav-link">Selenium Webdriver 集成</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/38db78/" class="nav-link">插件</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="系统详细信息" class="dropdown-title"><a href="/ranorex/pages/92d4ae/" class="link-title">系统详细信息</a> <span class="title" style="display:none;">系统详细信息</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ranorex/pages/b40b84/" class="nav-link">证书</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/d75d8f/" class="nav-link">设置和配置</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/0f08c7/" class="nav-link">系统要求</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/86b798/" class="nav-link">64位平台</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/31b776/" class="nav-link">静默安装</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="实践应用主题" class="dropdown-title"><a href="/ranorex/pages/74e52a/" class="link-title">实践应用主题</a> <span class="title" style="display:none;">实践应用主题</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/ranorex/pages/5011c0/" class="nav-link">构建您的测试</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/83d6aa/" class="nav-link">常见问题的解决方案</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/8ea041/" class="nav-link">最佳实践</a></li><li class="dropdown-item"><!----> <a href="/ranorex/pages/93ab6d/" class="nav-link">代码示例</a></li></ul></div></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>数据驱动测试</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>跟踪UI元素</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Ranorex Spy</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>UI元素</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>RanoreXPath</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/ranorex/pages/686444/" class="sidebar-link">介绍</a></li><li><a href="/ranorex/pages/ff0477/" class="sidebar-link">RanoreXPath 蓝图</a></li><li><a href="/ranorex/pages/dc4123/" aria-current="page" class="active sidebar-link">RanoreXPath 语法示例</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#测试示例定义" class="sidebar-link">测试示例定义</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#ranorex演示应用程序" class="sidebar-link">Ranorex演示应用程序</a></li></ul></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#简单按钮识别" class="sidebar-link">简单按钮识别</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#ranorexpath规范的一般化" class="sidebar-link">RanoreXPath规范的一般化</a></li></ul></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#用户定义的标识属性" class="sidebar-link">用户定义的标识属性</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#任何可选的-通配符示例" class="sidebar-link">/？（任何可选的）通配符示例</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#结果" class="sidebar-link">结果</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#ranorexpath解释" class="sidebar-link">RanoreXPath解释:</a></li></ul></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#任何后代-通配符示例" class="sidebar-link">//（任何后代）通配符示例</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#结果-2" class="sidebar-link">结果</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#ranorexpath解释-2" class="sidebar-link">RanoreXPath解释:</a></li></ul></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#任何-通配符的例子" class="sidebar-link">/ *(任何)通配符的例子</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#结果-3" class="sidebar-link">结果</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#ranorexpath解释-3" class="sidebar-link">RanoreXPath解释:</a></li></ul></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#缩小ranorexpath规范" class="sidebar-link">缩小RanoreXPath规范</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#通用ranorexpath规范" class="sidebar-link">通用RanoreXPath规范</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#缩小ranorexpath规范-第一部分" class="sidebar-link">缩小RanoreXPath规范 - 第一部分</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#缩小ranorexpath规范-第二部分" class="sidebar-link">缩小RanoreXPath规范 - 第二部分</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#缩小结果" class="sidebar-link">缩小结果:</a></li></ul></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#在ranorexpath规范中选择ui元素" class="sidebar-link">在RanoreXPath规范中选择UI元素</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#选择结果" class="sidebar-link">选择结果：</a></li></ul></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#树元素规范" class="sidebar-link">树元素规范</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#结果-4" class="sidebar-link">结果</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#子树项目规范" class="sidebar-link">子树项目规范</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#结果-5" class="sidebar-link">结果：</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#树的兄弟姐妹的规格" class="sidebar-link">树的兄弟姐妹的规格</a></li></ul></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#表项目规范" class="sidebar-link">表项目规范</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#基本表格方向" class="sidebar-link">基本表格方向</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#测试定义" class="sidebar-link">测试定义</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#绝对单元格位置规范" class="sidebar-link">绝对单元格位置规范</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#缺少对表格单元格更改的稳健性" class="sidebar-link">缺少对表格单元格更改的稳健性</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#单元格内容规格" class="sidebar-link">单元格内容规格</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#缩小范围的单元格规范" class="sidebar-link">缩小范围的单元格规范</a></li><li class="sidebar-sub-header"><a href="/ranorex/pages/dc4123/#相对单元格位置规范" class="sidebar-link">相对单元格位置规范</a></li></ul></li></ul></li><li><a href="/ranorex/pages/a4828f/" class="sidebar-link">RanoreXPath 语法</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>基于图像的自动化</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>维护模式</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>性能跟踪</span> <span class="arrow right"></span></p> <!----></section></li></ul> <div class="sidebar-slot sidebar-slot-bottom"><!-- 正方形 -->
      <ins class="adsbygoogle"
          style="display:block"
          data-ad-client="ca-pub-7828333725993554"
          data-ad-slot="3508773082"
          data-ad-format="auto"
          data-full-width-responsive="true"></ins>
      <script>
          (adsbygoogle = window.adsbygoogle || []).push({});
      </script></div></aside> <div><main class="page"><div class="theme-vdoing-wrapper "><div class="articleInfo-wrap" data-v-1cd794fe><div class="articleInfo" data-v-1cd794fe><ul class="breadcrumbs" data-v-1cd794fe><li data-v-1cd794fe><a href="/ranorex/" title="首页" class="iconfont icon-home router-link-active" data-v-1cd794fe></a></li> <li data-v-1cd794fe><a href="/ranorex/categories/?category=%E9%AB%98%E7%BA%A7" title="分类" data-v-1cd794fe>高级</a></li> <li data-v-1cd794fe><a href="/ranorex/categories/?category=RanoreXPath" title="分类" data-v-1cd794fe>RanoreXPath</a></li> <!----></ul> <div class="info" data-v-1cd794fe><div title="作者" class="author iconfont icon-touxiang" data-v-1cd794fe><a href="https://github.com/taylortaurus" target="_blank" title="作者" class="beLink" data-v-1cd794fe>TaylorTaurus</a></div> <div title="创建时间" class="date iconfont icon-riqi" data-v-1cd794fe><a href="javascript:;" data-v-1cd794fe>2021-11-22</a></div> <!----></div></div></div> <!----> <div class="content-wrapper"><div class="right-menu-wrapper"><div class="right-menu-margin"><div class="right-menu-content"></div></div></div> <h1><img src="">
          RanoreXPath 语法示例
        </h1> <div class="page-slot page-slot-top"><!-- 固定100% * 90px可显示，max-height:90px未见显示-->
     <ins class="adsbygoogle"
          style="display:inline-block;width:100%;max-height:90px"
          data-ad-client="ca-pub-7828333725993554"
          data-ad-slot="6625304284"></ins>
      <script>
          (adsbygoogle = window.adsbygoogle || []).push({});
      </script></div> <div class="theme-vdoing-content content__default"><h1 id="译-ranorexpath-语法示例"><a href="#译-ranorexpath-语法示例" class="header-anchor">#</a> [译] RanoreXPath 语法示例</h1> <p><em>原文地址 👉 <a href="https://www.ranorex.com/help/latest/ranorex-studio-advanced/ranorexpath/ranorexpath-syntax-examples/" target="_blank" rel="noopener noreferrer">RanoreXPath syntax examples<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></em></p> <p><em>@ translator : <a href="https://github.com/taylortaurus" target="_blank" rel="noopener noreferrer">TaylorTaurus<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></em><br> <em>♋ translate time : 2018-7-9</em><br> <em>♋ update time : 2018-7-9</em></p> <hr> <p>本章介绍了许多RanoreXPath语法示例，以加深你对在测试环境中应用强大的RanoreXPath规范的理解。</p> <h2 id="测试示例定义"><a href="#测试示例定义" class="header-anchor">#</a> 测试示例定义</h2> <p>所有RanoreXPath解释示例都是使用Ranorex演示应用程序创建的。本文提供的大多数示例都是使用演示应用程序的<strong>UI元素测试区域</strong>完成的。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000010.png" alt="B6020-0000010"> <em>Ranorex演示应用程序-UI元素测试区域</em></p> <ol><li>Ranorex 演示应用程序的UI元素测试区域</li></ol> <h3 id="ranorex演示应用程序"><a href="#ranorex演示应用程序" class="header-anchor">#</a> Ranorex演示应用程序</h3> <p>可以按照以下显示的链接下载演示应用程序。 下载文件，解压缩并启动演示应用程序。</p> <blockquote><p><strong>下载</strong><br>
主题：Ranorex 演示应用程序<br>
时间：小于10min<br> <a href="https://www.ranorex.com/rx-media/rx-user-guide/v8.2/download/RxDemoApp.zip" target="_blank" rel="noopener noreferrer">点我下载<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p></blockquote> <h2 id="简单按钮识别"><a href="#简单按钮识别" class="header-anchor">#</a> 简单按钮识别</h2> <p>本节介绍如何识别用户界面的简单按钮并分析相应的RanoreXPath规范。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000020.png" alt="B6020-0000020"><br> <em>简单按钮识别</em></p> <ol><li>有关演示应用程序的 <code>退出</code> 按钮，请参阅RanoreXPath规范</li> <li>树浏览器显示 <code>退出</code> 按钮是根UI元素 <code>RxMainFrame</code> 的直接子节点</li> <li>使用 <code>controlname</code> 识别 <code>退出</code> 按钮</li> <li>Spy状态信息（左下角窗口）确认找到一个UI元素</li></ol> <h3 id="ranorexpath规范的一般化"><a href="#ranorexpath规范的一般化" class="header-anchor">#</a> RanoreXPath规范的一般化</h3> <p>由于<strong>退出</strong>按钮是演示应用程序当前GUI层中的唯一按钮，因此可以概括RanoreXPath规范而不会丢失按钮的跟踪。如何做到请看下述。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000030.png" alt="B6020-0000030"><br> <em>RanoreXPath规范的一般化</em></p> <ol><li>请查看一般化的RanoreXPath规范，只使用了角色 <code>button</code> 和移除了谓词规范</li> <li>树浏览器仍然将UI元素<strong>退出</strong>按钮显示为根元素的直接子元素</li> <li>路径编辑器树视图显示了通用的RanoreXPath规范</li> <li>尽管如此，一个UI元素(即<strong>退出</strong>按钮)还是被标识出来了</li></ol> <blockquote><p><strong>注意</strong><br>
此示例成功，因为在指定级别上只有一个按钮。如果添加了一个额外的按钮，当前示例将无法跟踪和标识一个按钮。</p></blockquote> <h2 id="用户定义的标识属性"><a href="#用户定义的标识属性" class="header-anchor">#</a> 用户定义的标识属性</h2> <p>Ranorex自动选择识别属性。 这个选择可以随意改变。 以下是如何选择用户定义的标识属性。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000040.png" alt="B6020-0000040"><br> <em>用户定义的标识属性</em></p> <ol><li>在路径编辑器中查看选择的属性值键值对 <code>controltext='Exit'</code></li> <li>谓词已添加到RanoreXPath规范中</li> <li>它也显示在路径编辑的树视图中</li> <li>结果，仍然会识别“退出”按钮</li></ol> <blockquote><p><strong>提示</strong><br>
Spy状态行显示RanoreXPath规范是否唯一，以及是否使用当前RanoreXPath规范标识了多少UI元素。</p></blockquote> <h2 id="任何可选的-通配符示例"><a href="#任何可选的-通配符示例" class="header-anchor">#</a> /？（任何可选的）通配符示例</h2> <p>通配符为RanoreXPath规范增加了灵活性和健壮性。UI元素的识别对图形用户界面的结构变化更加具有抵抗力。目标是设计一个ui元素标识(理想情况下是独立于底层GUI结构的)。</p> <blockquote><p><strong>注意</strong><br>
记住前一节中的通配符定义:</p> <table><thead><tr><th style="text-align:left;">通配符</th> <th style="text-align:center;">含义</th> <th style="text-align:left;">描述</th></tr></thead> <tbody><tr><td style="text-align:left;"><code>/*</code></td> <td style="text-align:center;">任意一个</td> <td style="text-align:left;">任何UI元素，恰好是一（1）个树级别</td></tr> <tr><td style="text-align:left;"><code>/?</code></td> <td style="text-align:center;">任意一个可选</td> <td style="text-align:left;">任何UI元素，正好是零（0）或一（1）树级别</td></tr> <tr><td style="text-align:left;"><code>//</code></td> <td style="text-align:center;">任意一个后代</td> <td style="text-align:left;">任意数量的树级别的任何UI元素</td></tr></tbody></table></blockquote> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000050.png" alt="B6020-0000050"><br> <em>'任何'通配符示例</em></p> <ol><li>跟踪演示应用程序的UI元素测试区域的窗格</li></ol> <h3 id="结果"><a href="#结果" class="header-anchor">#</a> 结果</h3> <p>结果可以在Spy树浏览器和路径编辑器中看到。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000060.png" alt="B6020-0000060"><br> <em>Spy树浏览器和'/？'示例的路径编辑器</em></p> <ol><li><strong>根</strong>元素表示RanoreXPath规范的开头</li> <li>中间的UI元素``TabPageList<code>被两个</code>/?<code>通配符使路径规范健壮。即使</code>TabPage` 元素向下或向上移动一级，该路径仍然有效</li> <li><strong>节点</strong>UI元素是RanoreXPath规范的目标UI元素，并通过其角色和 <code>controlname</code> 属性定义</li></ol> <h3 id="ranorexpath解释"><a href="#ranorexpath解释" class="header-anchor">#</a> RanoreXPath解释:</h3> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000070.png" alt="B6020-0000070"><br> <em>RanoreXPath规范通配符/?示例</em></p> <p><strong>目标元素</strong><code>3</code>是<strong>根元素</strong><code>1</code>的后代元素，其中最多有两个（0,1或2）非必需指定的<strong>UI元素</strong><code>2</code></p> <h2 id="任何后代-通配符示例"><a href="#任何后代-通配符示例" class="header-anchor">#</a> //（任何后代）通配符示例</h2> <p>通常需要在GUI中查找和跟踪元素，我们不知道元素的“<strong>深度</strong>”。因此，“所有路径后代”运算符允许搜索元素的“所有”后代级别以跟踪特定的UI元素。如何做到请看下述。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000080.png" alt="B6020-0000080"><br> <em>使用//（任何后代）通配符的RanoreXPath规范示例</em></p> <ol><li>参见演示应用程序程序窗口，它的角色 <code>/form</code> 指定为RanoreXPath规范的<strong>根</strong>元素</li> <li>通配符运算符指定下面任何级别的任何元素</li> <li>目标UI元素仅限于角色 <code>radiobutton</code>，即搜索根元素内和以下级别的任何单选按钮</li></ol> <h3 id="结果-2"><a href="#结果-2" class="header-anchor">#</a> 结果</h3> <p>结果可以在Ranorex Spy中看到。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000090.png" alt="B6020-0000090"><br> <em>//（任何后代）通配符的查找结果</em></p> <ol start="4"><li>请参阅Spy的路径编辑器，其中RanoreXPath规范显示为树元素</li> <li>UI元素树浏览器显示所有找到的UI元素，即两个不同级别的7个单选按钮（级别3和级别4）</li> <li>Spy左下角的状态信息确认了7个找到的单选按钮</li></ol> <h3 id="ranorexpath解释-2"><a href="#ranorexpath解释-2" class="header-anchor">#</a> RanoreXPath解释:</h3> <p>搜索并识别<strong>根元素</strong> <code>1</code>中和下级 <code>2</code>的<strong>任一单选按钮</strong> <code>3</code>。</p> <h2 id="任何-通配符的例子"><a href="#任何-通配符的例子" class="header-anchor">#</a> / *(任何)通配符的例子</h2> <p>如果要查找具有完全已知“深度”的UI元素，则可以使用“任何”通配符运算符作为你选择的工具。 请参阅其应用程序的简单示例。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000100.png" alt="B6020-0000100"><br>
*具有/ <em>（任意）通配符的RanoreXPath规范</em></p> <ol><li>演示应用程序的程序窗口作为RanoreXPath规范的<strong>根</strong>元素</li> <li>三个/*(任意)<strong>通配符</strong>操作符在根元素的下级三层搜索元素</li> <li>节点元素是角色为 <code>radiobutton</code> 的规范</li></ol> <h3 id="结果-3"><a href="#结果-3" class="header-anchor">#</a> 结果</h3> <p>搜索和识别结果可以在Ranorex Spy中看到：</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000110.png" alt="B6020-0000110"><br>
*搜索结果为/ <em>（任意）通配符运算符</em></p> <ol><li>请参阅具有树状结构的RanoreXPath规范元素的<strong>路径编辑器</strong>。每个通配符运算符代表根元素下面的一个搜索级别</li> <li>查看UI元素树浏览器，其中包含五（5）个角色 <code>radiobutton</code> 的UI元素，从根元素向下精确三（3）个级别</li> <li>左下角状态行确认了5个找到的UI元素</li></ol> <h3 id="ranorexpath解释-3"><a href="#ranorexpath解释-3" class="header-anchor">#</a> RanoreXPath解释:</h3> <p>搜索并识别在<strong>根元素</strong> <code>1</code> 下方正好<strong>三个等级</strong> <code>2</code> 的<strong>任何单选按钮</strong> <code>3</code></p> <h2 id="缩小ranorexpath规范"><a href="#缩小ranorexpath规范" class="header-anchor">#</a> 缩小RanoreXPath规范</h2> <p>在许多情况下，有必要将一般RanoreXPath规范缩小到更具体的规范，以便在GUI中查找和识别所选择的UI元素。这里介绍了缩小RanoreXPath规范的最常用方法。</p> <h3 id="通用ranorexpath规范"><a href="#通用ranorexpath规范" class="header-anchor">#</a> 通用RanoreXPath规范</h3> <p>让我们开始跟踪和识别演示应用程序的UI元素测试区域窗格中的所有按钮</p> <ol><li>启动Spy和演示应用程序并<strong>指定</strong>RanoreXPath，如下所示：</li></ol> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000120.png" alt="B6020-0000120"><br> <em>初始通用RanoreXPath规范的示例</em></p> <ol><li>以树状形式查看具有RanoreXPath规范的所有元素的路径编辑器，搜索<strong>UI元素测试区域</strong>窗格中和下方的任何按钮</li> <li>请在UI元素树浏览器查看，在演示应用程序中找到的17个按钮</li> <li>左下方的状态消息确认了17个找到的按钮</li></ol> <h3 id="缩小ranorexpath规范-第一部分"><a href="#缩小ranorexpath规范-第一部分" class="header-anchor">#</a> 缩小RanoreXPath规范 - 第一部分</h3> <p>在第一步中，RanoreXPath规范被缩小到“可见”按钮，即在GUI中未隐藏的按钮。</p> <ol><li>使用谓词更改RanoreXPath规范，如下所示：</li></ol> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000130.png" alt="B6020-0000130"><br> <em>缩小RanoreXPath规范的示例 - 第一部分</em></p> <ol><li>看到路径编辑器，其中节点元素使用属性 <code>visible ='True'</code> 进一步指定</li> <li>看到UI元素树浏览器，其中包含基于当前RanoreXPath规范找到的15个结果按钮</li> <li>左下方状态信息确认找到了15个按钮</li></ol> <h3 id="缩小ranorexpath规范-第二部分"><a href="#缩小ranorexpath规范-第二部分" class="header-anchor">#</a> 缩小RanoreXPath规范 - 第二部分</h3> <p>如果缩小RanoreXPath规范是不够的，则通过组合属性继续缩小，因为谓词可能是一种解决方案。查看下述这是怎么做的。</p> <ol><li>将下面列出的属性规范添加到当前RanoreXPath定义的谓词中。</li></ol> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000140.png" alt="B6020-0000140"><br> <em>缩小RanoreXPath规范的例子 - 第二部分</em></p> <ol><li>看到缩小的<strong>RanoreXPath</strong>规范，并将第二个属性/值对作为谓词。
<ul><li>搜索设置为所有可见按钮...</li> <li>有一个以字母 <code>btn</code> 开头的<strong>controlname</strong>属性</li></ul></li> <li>看到UI元素树浏览器，其中包含两个与RanoreXPath搜索规范相关的UI元素</li> <li>左下角的状态信息确认了两个找到的UI元素</li></ol> <blockquote><p><strong>提示</strong><br> <code>&gt;</code> 运算符是可以在RanoreXpath规范中使用的几个不同运算符之一。</p></blockquote> <h3 id="缩小结果"><a href="#缩小结果" class="header-anchor">#</a> 缩小结果:</h3> <p>缩小的RanoreXPath规范的搜索结果可以在下面显示的图像中看到 - “<strong>UI元素测试区域</strong>”窗格中的两个按钮被识别为匹配UI元素。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000150.png" alt="B6020-0000150"><br> <em>缩小的RanoreXPath搜索结果示例</em></p> <h2 id="在ranorexpath规范中选择ui元素"><a href="#在ranorexpath规范中选择ui元素" class="header-anchor">#</a> 在RanoreXPath规范中选择UI元素</h2> <p>可以使用RanoreXPath语法的元素选择运算符直接选择一组跟踪和标识元素中的单个元素。下述介绍如何做到这一点。</p> <ol><li>将下面列出的RanoreXPath规范<strong>插入</strong>到当前示例中</li></ol> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000160.png" alt="B6020-0000160"><br> <em>在RanoreXPath规范中选择元素的示例</em></p> <ol><li>看到<strong>路径编辑器</strong>，将选择 <code>[2]</code> 运算符添加到谓词中，从当前RanoreXPath规范标识的元素列表中选择第二个元素</li> <li>看到UI元素树浏览器，将第二个UI元素标识为RanoreXPath规范的搜索结果</li> <li>在左下角的Spy状态信息中看到搜索结果的确认</li></ol> <h3 id="选择结果"><a href="#选择结果" class="header-anchor">#</a> 选择结果：</h3> <p>选择结果是“<strong>UI元素测试区域</strong>”窗格的两个已识别按钮中的第二个：</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000170.png" alt="B6020-0000170"><br> <em>RanoreXPath选择结果</em></p> <blockquote><p><strong>提示</strong><br>
排序顺序就是UI元素在元素树中出现的顺序。该顺序是前面的谓词定义的结果，并且可能与UI元素命名没有任何共同之处（即“按钮1”）。</p></blockquote> <h2 id="树元素规范"><a href="#树元素规范" class="header-anchor">#</a> 树元素规范</h2> <p>本节介绍和解释树元素的跟踪和识别。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000180.png" alt="B6020-0000180"><br> <em>使用Ranorex Spy跟踪树UI元素</em></p> <ol><li>单击Ranorex Spy的Track按钮并跟踪</li> <li>演示应用程序中UI元素测试区域的树元素</li></ol> <h3 id="结果-4"><a href="#结果-4" class="header-anchor">#</a> 结果</h3> <p>Ranorex将树元素标识如下：</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000190.png" alt="B6020-0000190"><br> <em>使用Ranorex识别树元素</em></p> <ol><li>看到在网页和移动测试中树项目的追踪结果的RanoreXPath规范</li> <li>Ranorex插入两个“任意可选”通配符（<code>/?/?</code>），为跟踪结果添加路径稳健性和灵活性</li> <li>网页和移动测试树项被识别为树的后代。如果树项在树的一个或两个级别之内和之下，则路径灵活性允许成功识别</li></ol> <h3 id="子树项目规范"><a href="#子树项目规范" class="header-anchor">#</a> 子树项目规范</h3> <p>通过指定任何顶部节点的树节点来揭示在树内跟踪和识别树项的概念。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000200.png" alt="B6020-0000200"><br> <em>使用Ranorex Spy跟踪子树UI元素</em></p> <ol><li>使用Ranorex Spy的<strong>Track按钮</strong></li> <li>跟踪演示应用程序的UI元素测试区域中的子树项目端点</li></ol> <h3 id="结果-5"><a href="#结果-5" class="header-anchor">#</a> 结果：</h3> <p>Ranorex识别子树项目如下：</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000210.png" alt="B6020-0000210"><br> <em>使用Ranorex Spy识别子树元素</em></p> <ol><li>看到的RanoreXPath规范，并将子树项Endpoints标识为普通树项</li> <li>Ranorex将树保留为RanoreXPath规范的祖先元素</li> <li>所有子树项都被标识为简单树项，通过<strong>任何后代</strong>通配符运算符独立于它们在树中的位置</li> <li>看到子树项被标识为规则树项，以及使用 <code>accessiblename</code> 作为谓词</li></ol> <blockquote><p><strong>注意</strong><br>
Ranorex将所有子树项视为常规树项，并通过唯一谓词规范来标识它们。树中的位置并不重要，因此，树结构的变化不会改变识别成功。</p></blockquote> <h3 id="树的兄弟姐妹的规格"><a href="#树的兄弟姐妹的规格" class="header-anchor">#</a> 树的兄弟姐妹的规格</h3> <p>通过轴说明符对RanoreXPath规范进行简单修改，可以跟踪和识别当前树项的下一个和前一个兄弟树项。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000220.png" alt="B6020-0000220"><br> <em>将轴说明符应用于RanoreXPath规范</em></p> <ol><li>看到RanoreXPath规范，添加的<strong>轴说明符</strong>跟踪以下树项同级</li> <li><strong>路径编辑器</strong>以树状结构显示RanroeXPath规范</li> <li>UI元素树浏览器显示标识结果，移动测试树项作为端点树项的下一个兄弟树项</li></ol> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000230.png" alt="B6020-0000230"><br> <em>识别兄弟树项目</em></p> <ol start="4"><li>查看正在测试的应用程序的<strong>UI元素测试区域</strong>，其中树元素移动测试显示为端点树项目的兄弟元素</li></ol> <blockquote><p><strong>注意</strong><br>
如果存在多个兄弟元素，则轴指定符号 <code>follow -sibling</code> 返回所有后级的兄弟元素。。</p></blockquote> <h2 id="表项目规范"><a href="#表项目规范" class="header-anchor">#</a> 表项目规范</h2> <p>跟踪和识别表中的元素是一种高级规范方法，并且需要一些在此引入和解释的基本知识。</p> <h3 id="基本表格方向"><a href="#基本表格方向" class="header-anchor">#</a> 基本表格方向</h3> <p>表格单元的寻址遵循一个重要的理解系统，并在下图中显示。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000240.png" alt="B6020-0000240"><br> <em>基本表格方向</em></p> <p><strong>重点：</strong></p> <ul><li>表列由其标题名称标识</li> <li>表行已编号，在标题下方的第一行中以“0”开头</li> <li>表格单元格通常由列名称和行号组合标识</li></ul> <ol><li>绝对单元格规范的示例：单元格“Thomas”由列名和行号组合绝对指定</li> <li>相对单元格规范的示例：单元格“Development”被相对指定为通过一个轴说明符 <code>/..</code>绝对指定一个锚单元格之后的第6个单元格。</li></ol> <h3 id="测试定义"><a href="#测试定义" class="header-anchor">#</a> 测试定义</h3> <p>当前测试示例的目的是在演示应用程序的UI元素测试区域的表中唯一地标识名为Thomas Bach的人的年龄。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000250.png" alt="B6020-0000250"><br> <em>表格单元规范 - 测试定义</em></p> <ol><li>看到<strong>表格条目（行）</strong>，其中包含名字，姓氏，年龄，性别和部门从属关系</li> <li>托马斯巴赫的<strong>年龄</strong>将通过RanoreXPath规范强有力地选择</li></ol> <h3 id="绝对单元格位置规范"><a href="#绝对单元格位置规范" class="header-anchor">#</a> 绝对单元格位置规范</h3> <p>在第一个简单的方法中，具有'Thomas Bach'人名的单元格可以通过单元格绝对位置来识别：</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000260.png" alt="B6020-0000260"><br> <em>绝对表格单元规范</em></p> <ol><li>看到使用表单元格绝对指定的RanoreXPath规范</li> <li>RanoreXPath规范引用“FirstName”列中的单元格和行号3 - 在我们当前的例子中 - 包含托马斯这个名字</li> <li>看到Spy的树形浏览器视图中标识的UI元素</li></ol> <h3 id="缺少对表格单元格更改的稳健性"><a href="#缺少对表格单元格更改的稳健性" class="header-anchor">#</a> 缺少对表格单元格更改的稳健性</h3> <p>绝对单元规范缺乏对表格单元布置的改变的鲁棒性。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000270.png" alt="B6020-0000270"><br> <em>表单元格移动</em></p> <ol><li>移动表格单元的排列显示...</li> <li>绝对单元格导致错误的结果，因为规范依赖于单元格位置而不是期望的单元格内容</li></ol> <h3 id="单元格内容规格"><a href="#单元格内容规格" class="header-anchor">#</a> 单元格内容规格</h3> <p>单元格位置规格的改进是单元格内容的规范，其中我们基于其内容识别单元格</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000280.png" alt="B6020-0000280"><br> <em>单元格内容规范</em></p> <ol><li>指定单元格内容可以增强对表重组的稳健性，但是...</li> <li>导致识别具有指定内容的所有单元格，与列无关</li></ol> <h3 id="缩小范围的单元格规范"><a href="#缩小范围的单元格规范" class="header-anchor">#</a> 缩小范围的单元格规范</h3> <p>还需要将单元格规范限制为名字'Thomas'（和姓氏'Bach'）。这是通过缩小的单元规范来完成的。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000290.png" alt="B6020-0000290"><br> <em>缩小范围的单元格规范</em></p> <ol><li>看到缩小的单元格规范，其中两个属性构成RanoreXPath谓词...</li> <li>结果，是当前示例的唯一标识的单元格</li></ol> <blockquote><p><strong>提示</strong><br>
可能有必要通过附加属性和/或其他轴指定符进一步指定单元格，以便唯一地指定定义的单元格。在当前示例中，两个属性就足够了。</p></blockquote> <h3 id="相对单元格位置规范"><a href="#相对单元格位置规范" class="header-anchor">#</a> 相对单元格位置规范</h3> <p>最后，为了指定名为“Thomas Bach”的人的年龄的单元格，需要相对单元格规范。</p> <p><img src="https://gitee.com/taylortaurus/RX_UserGuide_GitBook_Picbed/raw/master/RanoreXPath/B6020-0000300.png" alt="B6020-0000300"><br> <em>相对单元格规范</em></p> <ol><li>使用单元格的accessname属性“Age”来相对指定识别单元格</li> <li>表中行为“Thomas Bach”的年龄为42</li></ol></div></div> <div class="page-slot page-slot-bottom"><!-- 横向自适应 -->
      <ins class="adsbygoogle"
          style="display:block"
          data-ad-client="ca-pub-7828333725993554"
          data-ad-slot="6620245489"
          data-ad-format="auto"
          data-full-width-responsive="true"></ins>
      <script>
          (adsbygoogle = window.adsbygoogle || []).push({});
      </script></div> <div class="page-edit"><!----> <!----> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">11/26/2021, 2:14:10 PM</span></div></div> <div class="page-nav-wapper"><div class="page-nav-centre-wrap"><a href="/ranorex/pages/ff0477/" class="page-nav-centre page-nav-centre-prev"><div class="tooltip">RanoreXPath 蓝图</div></a> <a href="/ranorex/pages/a4828f/" class="page-nav-centre page-nav-centre-next"><div class="tooltip">RanoreXPath 语法</div></a></div> <div class="page-nav"><p class="inner"><span class="prev">
        ←
        <a href="/ranorex/pages/ff0477/" class="prev">RanoreXPath 蓝图</a></span> <span class="next"><a href="/ranorex/pages/a4828f/">RanoreXPath 语法</a>→
      </span></p></div></div></div> <div class="article-list"><div class="article-title"><a href="/ranorex/archives/" class="iconfont icon-bi">最近更新</a></div> <div class="article-wrapper"><dl><dd>01</dd> <dt><a href="/ranorex/pages/93ab6d/"><div>介绍</div></a> <span>11-22</span></dt></dl><dl><dd>02</dd> <dt><a href="/ranorex/pages/efb1ea/"><div>解决元素未找到错误</div></a> <span>11-22</span></dt></dl><dl><dd>03</dd> <dt><a href="/ranorex/pages/9be76e/"><div>添加解决方案设置到解决方案</div></a> <span>11-22</span></dt></dl> <dl><dd></dd> <dt><a href="/ranorex/archives/" class="more">更多文章&gt;</a></dt></dl></div></div></main></div> <div class="footer"><!----> 
  Theme by
  <a href="https://github.com/xugaoyi/vuepress-theme-vdoing" target="_blank" title="本站主题">Vdoing</a> 
    | Copyright © 2021-2021
    <span></span></div> <div class="buttons"><div title="返回顶部" class="button blur go-to-top iconfont icon-fanhuidingbu" style="display:none;"></div> <div title="去评论" class="button blur go-to-comment iconfont icon-pinglun" style="display:none;"></div> <div title="主题模式" class="button blur theme-mode-but iconfont icon-zhuti"><ul class="select-box" style="display:none;"><li class="iconfont icon-zidong">
          跟随系统
        </li><li class="iconfont icon-rijianmoshi">
          浅色模式
        </li><li class="iconfont icon-yejianmoshi">
          深色模式
        </li><li class="iconfont icon-yuedu">
          阅读模式
        </li></ul></div></div> <!----> <!----> <div class="custom-html-window custom-html-window-rb" style="display:;"><div class="custom-wrapper"><i class="close-but">×</i> <div><!-- 固定160*160px -->
      <ins class="adsbygoogle"
          style="display:inline-block;max-width:160px;max-height:160px"
          data-ad-client="ca-pub-7828333725993554"
          data-ad-slot="8377369658"></ins>
      <script>
          (adsbygoogle = window.adsbygoogle || []).push({});
      </script>
      </div></div></div></div><div class="global-ui"><div></div></div></div>
    <script src="/ranorex/assets/js/app.24b7eaa5.js" defer></script><script src="/ranorex/assets/js/2.ec9fdd2b.js" defer></script><script src="/ranorex/assets/js/80.6c0ca93e.js" defer></script>
  </body>
</html>
